package com.xnyzc.lhy.order.mapper.order;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xnyzc.lhy.order.entity.order.OaCOrderPersonal;
import com.xnyzc.lhy.order.entity.order.OaDOrder;
import com.xnyzc.lhy.order.entity.user.OaDUserOffice;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 自费叫车订单 Mapper 接口
 * </p>
 *
 * @author lhy@xnyzc.com
 * @since 2019-07-22
 */
public interface OaCOrderPersonalMapper extends BaseMapper<OaCOrderPersonal> {

    com.xnyzc.lhy.order.entity.mq.OaCOrderPersonal queryBillDetails(@Param("orderNo") String orderNo);

    /**
     * 获取orderNO和didiOrderId
     * @param status
     * @return
     */
    List<OaDOrder> getOrderMessage(@Param("status") Integer status);

    /**
     * 创建订单检查是否有重复订单
     * @param orderNo
     * @param didiOrderId
     * @return
     */
    int selectNumByOrderNoAndDidiId(@Param("orderNo") String orderNo, @Param("didiOrderId") String didiOrderId);

    Integer updateThrowFlagByOrderId(@Param("throwFlag")int throwFlag,@Param("orderNo") String orderNo);

    @Select("SELECT * FROM oa_d_user_office " +
            "WHERE oa_d_user_office.driver_id = #{driverId} " +
            "AND oa_d_user_office.office_id = #{officeId} ")
    OaDUserOffice selectDriverOfficeByOrder(@Param("driverId") Long driverId, @Param("officeId") Long officeId);
}
